home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1986 July & August / rerun-1986-07-08.d64 / mag printer (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  71 lines

  1. 1 rem mag printer v3.4
  2. 2 rem (c) 1986 david a. hook
  3. 10 a$="abcdefghijklmnopqrst": a$=a$+a$
  4. 30 rem issue file name
  5. 40 read f$
  6. 60 print "[147]"; tab(12); "[205][193][199][193][218][201][206][197] [208][210][201][206][212][197][210]"
  7. 70 print tab(9); "(c) 1986 [196]avid [193]. [200]ook"
  8. 80 print"  [211]end the [205]agazine [201]ssue to a [208]rinter  or the [211]creen."
  9. 90 print "  [207]nce started, [208]ause by striking a key"
  10. 100 print " [210]esume/[209]uit by striking another key."
  11. 120 lp=25: pp=66: ad=896: if peek(ad)-160 then gosub 1000: rem read data
  12. 140 print ""; tab(16); f$
  13. 150 input "[145][206]ame of issue:"; f$
  14. 170 dv=4: input "[208]rinter [196]evice #:  4[157][157][157]"; dv
  15. 180 if dv<3 or dv>5 goto 170
  16. 190 if dv=3 goto 230
  17. 210 sa=0: input "[211]econdary [193]ddress (lower case):  7[157][157][157]"; sa
  18. 230 open 15, 8, 15, "i0"
  19. 250 rem get total line count
  20. 260 open 2, 8, 2, f$
  21. 270 sys ad
  22. 280 ln=val(a$)-1: pg=ln/lp
  23. 290 close 2
  24. 300 if ln<1 or pg<>int(pg) then print "file error": close 15: stop
  25. 320 input "[198]irst [208]age to print:  1[157][157][157]"; p$
  26. 330 pf=int(val(p$)): if pf<1 then pf=1
  27. 340 if pf>pg then pf=pg
  28. 350 fl=(pf-1)*lp + 2
  29. 370 print tab(21); pg
  30. 380 input "[145][198]inal [208]age to print:"; p$
  31. 390 pl=int(val(p$)): if pl<1 then pl=1
  32. 400 if pl>pg then pl=pg
  33. 410 if pl<pf then pl=pf
  34. 420 ll=pl*lp + 1
  35. 440 rem fetch & print the lines
  36. 450 open 2, 8, 2, f$
  37. 470 open 4, dv, sa
  38. 490 lc=0
  39. 500 lm=1: cr=0
  40. 520 for i = fl to ll
  41. 540 print# 15, "p" + chr$(2) + chr$(i and 255) + chr$(i/256) + chr$(1)
  42. 550 sys ad
  43. 560 l=peek(142)
  44. 580 if l then lm=1-lm: cr=0: goto 630
  45. 600 cr=cr+1: if cr<3 or lm goto 710
  46. 610 lm=1: goto 670
  47. 630 if l=1 and left$(a$,l)=chr$(32) then lm=1
  48. 650 print#4, left$(a$,l);
  49. 670 if lm then print#4: lc=lc+1
  50. 690 if lc>pp-7 then lc=0: for j=1 to 6: print#4: next
  51. 710 get z$: if z$="" goto 780
  52. 730 print: print "[208]ress 'q' to quit, other to resume:[146] ?[157]";
  53. 740 get z$: if z$="" goto 740
  54. 750 if z$="q" then print "[209]uit";: i=ll
  55. 760 print
  56. 780 next
  57. 800 close 2
  58. 810 for i=1 to pp-lc: print#4: next
  59. 820 close4
  60. 830 end
  61. 899 rem issue file name
  62. 900 data "jul86"
  63. 999 rem read & store ml
  64. 1000 ck=0: for i=ad to ad+41: read da: poke i,da: ck=ck+da: next
  65. 1010 if ck<>6121 then print "error in data": stop
  66. 1030 return
  67. 1050 rem c64 string thing data (file 2)
  68. 1060 data 160,2,177,45,153,137,0,200,192,6,208,246,162,2
  69. 1070 data 32,198,255,32,228,255,201,13,240,15,164,142,145,140
  70. 1080 data 200,132,142,196,139,240,4,165,144,240,234,76,204,255
  71.